import { reactive } from "vue";
import { api } from 'boot/axios'
import { CommonApiPrefix } from 'src/common/const'
/**
 * @description 表格多选数据操作
 * @param {String} rowKey 当表格可以多选时，所指定的 id
 * */
export const useCourseList = () => {
  const list = reactive<any[]>([])
  const fetchData = async () => {
    try {
      const res = await api.get(`${CommonApiPrefix}/course/list`);
      list.push(...res.data)
    } catch (error) {
      console.log(error);
    }
  }
  fetchData();
  return [list];
};
